home *** CD-ROM | disk | FTP | other *** search
/ Secrets of Stargate / STARGATE.iso / mac / STARGATE (5MB Macintosh) / STARGATE (5MB Macintosh).DXR / 00010_Build Scripts.ls < prev    next >
Encoding:
Text File  |  1994-10-19  |  6.5 KB  |  211 lines

  1. on importPICs
  2.   set c to 0
  3.   repeat with z = 1 to 1000
  4.     set cT to string(the castType of cast z)
  5.     if (cT contains "Bitmap") or (cT contains "PIC") then
  6.       set theFile to the fileName of cast z
  7.       if theFile <> EMPTY then
  8.         set theName to the name of cast z
  9.         if (theName = "PS_MARKG.PIC") or (theName = "VideoDouble") or (theName = "PEOPLEHS.PIC0") or (theName = "PEOPLEHS.PIC1") or (theName = "AWLNDSC.PIC0") or (theName = "AWLNDSC.PIC1") or (theName = "AWPORTR.PIC0") or (theName = "AWPORTR.PIC1") then
  10.           next repeat
  11.         end if
  12.         if the freeBlock < 1000000 then
  13.           put "Not enough memory to continue import.  Please save changes, re-open " & "this file, and re-run the IMPORTPICS handler to continue.  " & "You may need to do this several times."
  14.           exit
  15.           next repeat
  16.         end if
  17.         put "Importing PICT " & z
  18.         set thePal to the palette of cast z
  19.         puppetPalette(thePal)
  20.         set regP to the regPoint of cast z
  21.         importFileInto(cast z, theFile)
  22.         set the regPoint of cast z to regP
  23.       end if
  24.     end if
  25.   end repeat
  26.   puppetPalette(0)
  27. end
  28.  
  29. on setPalette
  30.   repeat with z = 233 to 257
  31.     set the palette of cast z to 373
  32.   end repeat
  33. end
  34.  
  35. on fixFontsPeople
  36.   set the foreColor of cast "Person Name0" to 18
  37.   set the foreColor of cast "Person Name1" to 18
  38.   set the foreColor of cast "Person Title0" to 18
  39.   set the foreColor of cast "Person Title1" to 18
  40.   set the backColor of cast "Person Name0" to 255
  41.   set the backColor of cast "Person Name1" to 255
  42.   set the backColor of cast "Person Title0" to 255
  43.   set the backColor of cast "Person Title1" to 255
  44. end
  45.  
  46. on movFonts
  47.   set the foreColor of cast "About Stage" to 16
  48.   set the foreColor of cast "MOVTXT_C3" to 16
  49.   set the foreColor of cast "MOVTXT_C2" to 16
  50.   set the foreColor of cast "MOVTXT_C1" to 16
  51.   set the backColor of cast "About Stage" to 250
  52.   set the backColor of cast "MOVTXT_C3" to 250
  53.   set the backColor of cast "MOVTXT_C2" to 250
  54.   set the backColor of cast "MOVTXT_C1" to 250
  55. end
  56.  
  57. on sbFonts
  58.   set the foreColor of cast "SB_Scene" to 16
  59.   set the foreColor of cast "SB_Name" to 16
  60.   set the foreColor of cast "SB_Shot" to 16
  61.   set the backColor of cast "SB_Scene" to 250
  62.   set the backColor of cast "SB_Name" to 250
  63.   set the backColor of cast "SB_Shot" to 250
  64. end
  65.  
  66. on setFiles
  67.   repeat with z = 1 to 1000
  68.     if (z mod 50) = 0 then
  69.       put z
  70.     end if
  71.     set cT to string(the castType of cast z)
  72.     if (cT contains "Bitmap") or (cT contains "PIC") or (cT contains "Video") then
  73.       set the fileName of cast z to the fileName of cast z
  74.     end if
  75.   end repeat
  76. end
  77.  
  78. on findCastFile
  79.   repeat with z = 1 to 1000
  80.     set cT to string(the castType of cast z)
  81.     if (cT contains "Bitmap") or (cT contains "PIC") then
  82.       set cfName to the fileName of cast z
  83.       if offset("Title.PIC", cfName) > 0 then
  84.         beep()
  85.         put z
  86.       end if
  87.     end if
  88.   end repeat
  89. end
  90.  
  91. on findScript theNum
  92.   set theNum to value(theNum)
  93.   repeat with z = 1 to 1000
  94.     if the script of cast z = theNum then
  95.     end if
  96.   end repeat
  97. end
  98.  
  99. on updateMovies
  100.   set startCast to 400
  101.   set movieData to field "MOVBLD"
  102.   set numRecs to the number of lines in movieData
  103.   set the itemDelimiter to "|"
  104.   if numRecs > 70 then
  105.     alert("Number of records (" & numRecs & ") exceeds slots (70)")
  106.     exit
  107.   end if
  108.   repeat with z = 1 to numRecs
  109.     put z
  110.     set thisData to line z of movieData
  111.     set theFile to item 1 of thisData
  112.     set theName to item 2 of thisData
  113.     set thePalette to item 3 of thisData
  114.     set hasAudio to item 4 of thisData
  115.     set castNum to startCast + z - 1
  116.     set the fileName of cast castNum to theFile
  117.     set the name of cast castNum to theName
  118.     set palCastNum to the number of cast (thePalette && "Palette")
  119.     if palCastNum < 1 then
  120.       put "No palette imported: " & thePalette
  121.     end if
  122.     set the pausedAtStart of cast castNum to 1
  123.     set the loop of cast castNum to 0
  124.     set the crop of cast castNum to 0
  125.     set the center of cast castNum to 0
  126.     set the directToStage of cast castNum to 1
  127.     set the video of cast castNum to 1
  128.     set the sound of cast castNum to value(hasAudio)
  129.     set the preLoad of cast castNum to 0
  130.   end repeat
  131.   repeat with z = numRecs + 1 to 70
  132.     set castNum to startCast + z - 1
  133.     set the fileName of cast castNum to "TRAILER.MOV"
  134.     set the pausedAtStart of cast castNum to 1
  135.     set the name of cast castNum to "Unused Movie"
  136.   end repeat
  137.   set the itemDelimiter to ","
  138. end
  139.  
  140. on rebuildPalettes
  141.   rebuildPalette()
  142. end
  143.  
  144. on rebuildPalette
  145.   global gPaletteTable
  146.   pause()
  147.   set gPaletteTable to EMPTY
  148.   set start to the frame
  149.   repeat with z = 1 to the lastFrame
  150.     pause()
  151.     go(z)
  152.     if (the castNum of sprite 1 > 1) or (the castNum of sprite 3 > 1) then
  153.       set f to the framePalette
  154.       if f = -1 then
  155.         set f to 0
  156.       end if
  157.       put f into line z of gPaletteTable
  158.     end if
  159.   end repeat
  160.   put gPaletteTable into field "Palette Table"
  161.   go(start)
  162. end
  163.  
  164. on updateFields
  165.   repeat with z = 1 to 1000
  166.     put z
  167.     if string(the castType of cast z) contains "Text" then
  168.       set the textFont of field z to "Palatino"
  169.     end if
  170.   end repeat
  171. end
  172.  
  173. on findSize
  174.   repeat with z = 1 to 1000
  175.     set cT to string(the castType of cast z)
  176.     if (cT contains "Bitmap") or (cT contains "PIC") then
  177.       put z && the size of cast z && the palette of cast z
  178.     end if
  179.   end repeat
  180. end
  181.  
  182. on findPalette findPal
  183.   set findPal to value(findPal)
  184.   repeat with z = 1 to 1000
  185.     set cT to string(the castType of cast z)
  186.     if (cT contains "Bitmap") or (cT contains "PIC") then
  187.       if the palette of cast z = findPal then
  188.         put z
  189.       end if
  190.     end if
  191.   end repeat
  192. end
  193.  
  194. on importAll
  195.   global gReadObj
  196.   spinCursor()
  197.   set theFiles to "MOVBLD,MOVTXT_1,MOVTXT_C1,MOVTXT_C2,MOVTXT_C3,MOVTXT_CD," & "MOVTXT_CN,MOVTXT_F,PSDATA_0,PSDATA_1,PSDATA_2,PSDATA_3,PSDATA_C," & "PSDATA_D,PSDATA_R1,PSDATA_R2,SBTXT_0,SBTXT_1,SBTXT_2,SBTXT_3,SBTXT_4,SBTXT_PD," & "SBTXT_PU,PEOPLE_0,PEOPLE_1,PEOPLE_2,PEOPLE_3,PEOPLE_C,PEOPLE_D,PEOPLE_P1,PEOPLE_P2,PEOPLE_P3," & "IVTXT_1,IVTXT_P,IVTXT_PD,IVTXT_PR,IVTXT_Q,IVTXT_QD,IVTXT_QR," & "ANWIS_0,ANWIS_1,ANWIS_2,ANWIS_3,ANWIS_4,ANWIS_5,ANWIS_6,ANWIS_7,ANWIS_CD,ANWIS_CN,ANWIS_CT," & "ANWIS_C1,ANWIS_C2,ANWIS_C3,ANWIS_C4,ANWIS_C5,HELP_L1,HELP_L2"
  198.   set prefix to "STARGATE: BUILD Data:"
  199.   repeat with z = 1 to the number of items in theFiles
  200.     set thisFile to item z of theFiles
  201.     set gReadObj to FileIO(mnew, "read", prefix & thisFile)
  202.     put "importAll" && thisFile
  203.     put gReadObj(mReadFile) into field thisFile
  204.     gReadObj(mdispose)
  205.   end repeat
  206. end
  207.  
  208. on devAlert t
  209.   alert(t)
  210. end
  211.